<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>配送关系管理</title>
 <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>中标生产企业</h1>
        <ol class="breadcrumb">
           <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">目录管理</a></li>
            <li class="active"><a href="#">配送关系管理</a></li>
            <li class="active"><a href="#">设置配送关系</a></li>
        </ol>
    </section>
    
		
		<section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="form-inline">  
                <div class="form-group form-group-xs">
			            <label>企业编码：</label>
			            <input class="form-control" type="text" id="compCode" name="compCode" placeholder="企业编码"  />
			        </div>              
				    <div class="form-group form-group-xs">
			            <label>企业名称：</label>
			            <input class="form-control" type="text" id="compName" name="compName" placeholder="企业名称"  />
			        </div>
	                <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm">查&nbsp;询</button>
	            </div>
			</div>
		</div>
<div style="margin-top: 5px;"></div>
	<table class="jqgrid" id="gridlist"></table>
<div style="margin-top: 10px;"></div>
<div id="prowed2"></div>
</section>
<%@ include file="/WEB-INF/component/commonJS.jsp"%>
<script type="text/javascript">
$(document).ready(function (){
	jQuery("#gridlist").jqGrid({
		url: "${ctx}/baseDel/getDelProdCompData.html",
	    mtype: "POST",
		datatype: "json",
		autowidth: true,
		shrinkToFit: true,
	//	height: 347,
	   	colNames:['操作','企业编码','企业名称','组织机构代码','地区','联系人','联系电话'],
	   	colModel:[
			{name:'oper',index:'oper',width:100,align:"center", sorttype:false,sortable:false,
	   			formatter:function(val, opts,row) {
	   				var str = "<a href='${ctx}/baseDel/toDelByHospList.html?compCode="+row.comp_code+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -140px -60px' class='opIcon' title='按医疗机构设置配送企业'></a>";
	   				str += "<a href='${ctx}/baseGoods/toTheDelCompList.html?compCode="+row.comp_code+"&compName="+row.comp_name+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -120px -60px' class='opIcon' title='按企业设置医疗机构'></a>";
	   				return str;
		   		}},
	   		{name:'comp_code',index:'comp_code',width:100,align:"center", sorttype:false,sortable:false},
	   		{name:'comp_name',index:'comp_name',width:150,align:"center",sortable:false,sortable:false,
	   			formatter:function(val, opts,row) {
		   			 return "<a href=\"javascript:void(0);\" onclick=\"showCompInfo('"+row.comp_code+"', '"+ val +"')\">"+val+"</a>"
		   			}},
	   		{name:'org_code',index:'org_code',width:80, align:"center",sorttype:false,sortable:false},
	   		{name:'area_name',index:'area_name',width:80, align:"center",sorttype:false,sortable:false},
	   		{name:'contact_name',index:'contact_name',width:80, align:"center",sorttype:false,sortable:false},
	   		{name:'contact_telephone',index:'contact_telephone',width:60,align:"center", sorttype:false,sortable:false}
	   	],
		
		 rowNum: 20,
	     rowList: [10, 20, 50,100],
	     rownumbers: true,
	     multiselect: false,
	     pager: "#prowed2",
	     viewrecords: true,
		gridComplete: function(){
			//序号列宽度自适应（参数为jqgridID）
			 autoRNWidth("gridlist");
			//数据只有一条时默认选中（参数为jqgridID）
			 selectByOneData("gridlist");
		 },
	     caption: "生产企业列表",
	     jsonReader: {
	         repeatitems: false,
	         id: "ids"
	     }
	   	
	});
	$("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
            $(window).trigger("resize");
			$("#gridlist").jqGrid("setGridHeight", create());
})

function gridSerch(){
	var compCode = $.trim($("#compCode").val());
	var compName = $.trim($("#compName").val());
	$("#gridlist").jqGrid('setGridParam',{  
        datatype:'json',
        postData:{"compCode":compCode,
        		"compName":compName,
        		"hospCode":"${param.hospCode}",
        		"goodsCode":"${param.goodsCode}",
        		"projId":"${param.projId}"},
        		page:1
    }).trigger("reloadGrid"); //重新载入  
}

	    
</script>
</body>
</html>